package com.javajun.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;

import com.javajun.custom.BaseService;
import com.javajun.entity.Customer;
import com.javajun.entity.Enterprise;
import com.javajun.repository.CustomerRepository;

@Service
public class CustomerService extends BaseService<Customer, Integer>{

    @Autowired
    private CustomerRepository customerRepository;
    
    public Page<Customer> findByEnterprise(Enterprise enterprise, Pageable pageable) {
        return customerRepository.findByEnterprise(enterprise, pageable);
    }

    public Customer findByUsername(String username) {
        return customerRepository.findByUsername(username);
    }
}
